package com.tear.language.node;

import java.util.Map;

import net.sf.json.JSONObject;

import com.tear.language.utils.Attrs;

/**
选择操作--类似与switch-case中的switch

*/
public class ChooseNode extends BaseNode {

	@Override
	public boolean parse(Map<String, Object> currParams,Map<String, Object> globalParams, JSONObject obj) throws Exception {
		//在局部变量中放入该选择的是否选中正确的when标志，为true表示已经选中，如果下面还有满足条件的也不会再选择进入
		currParams.put(Attrs.WHEN_FLAG, false);
		return true;
	}

	@Override
	public void pre(Map<String, Object> currParams,
			Map<String, Object> globalParams, JSONObject obj) throws Exception {
		System.out.println("choose执行之前");
	}

	@Override
	public void after(Map<String, Object> currParams,
			Map<String, Object> globalParams, JSONObject obj) throws Exception {
		System.out.println("choose执行之后");
	}

	
	
}
